import axios from 'axios'


export default {

   login: async (data) => {
      try {
         const r = await axios.post('/api/user/login', data)
         debugger
         return r.data
      } catch (error) {
         debugger
         console.error(error)
         //return ??
      }

   },

   saveTodoItem: (data) => {
      axios.post('/api/moment/saveitem', data)
   },


   delItem: (data) => {
      axios.post('/api/deleteitem', data)
   },

   clearItems: () => {
      axios.post('/api/clearitems')
   },
   getAllTodoItems: async () => {

      const res = await axios.get('/api/getallitems')

      return res.data
      //console.log(res.data)
   },
   updateItem: async (data) => {
      axios.post('/api/updateitem', data)
   }

}